package net.crozz.openapi.douban;

import net.crozz.openapi.ApiException;
import net.crozz.openapi.douban.model.user.Resp_user;
import net.crozz.openapi.http.Param;
import net.crozz.openapi.http.Requester;

public class User {

    private Requester client;
    private String    baseURL;

    User(Requester client, String baseURL) {
        this.client = client;
        this.baseURL = baseURL;
    }

    /**
     * 根据用户ID获取用户信息<br/>
     * http://open.weibo.com/wiki/2/users/show<br/>
     * 参数uid与screen_name二者必选其一，且只能选其一
     *
     * @param access_token access_token
     */
    public Resp_user me(String access_token) throws ApiException {
        return client.getObj(
                Resp_user.class,
                baseURL + "/v2/user/crozz",
                Param.headerParam("access_token", access_token)
        );
    }

}
